package com.yangye.picommon.model;

import com.github.pagehelper.Page;
import lombok.Data;

import java.util.List;

/**
 * @author Page.Yang
 * @date 2019/4/3 0003
 */
@Data
public class PageModel<T> {

    private int pageNum;
    private int pageSize;
    private long total;
    private List<T> rows;
    private int pages;

    public PageModel() {
    }

    public PageModel(Page<T> page) {
        this.pageNum = page.getPageNum();
        this.pageSize = page.getPageSize();
        this.total = page.getTotal();
        this.rows = page.getResult();
        this.pages = page.getPages();
    }
}
